package com.souvc.xstream;

import com.thoughtworks.xstream.converters.SingleValueConverter;

public  class AuthorConverter implements SingleValueConverter {


    public String toString(Object obj) {
        return ((Author) obj).getName();
    }

    public Object fromString(String str) {
        return new Author(str);
    }

    public boolean canConvert(Class type) {
        return type.equals(Author.class);
    }
}